package com.atguigu.wordcount.keyvaluetextinputformat;

import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @ClassName WcMapper
 * @DeScription WcMapper
 * @Author 剧情再美终是戏
 * @Date 2019/11/16 14:48
 * @Version 1.0
 **/
public class WcMapper extends Mapper<Text, Text, Text, IntWritable> {

    // 设置输出参数
    private IntWritable outVal = new IntWritable(1);

    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
        System.out.println(key);
       context.write(key, outVal);
    }
}
